package lhl.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;


@Getter
@ToString //重写tostring
@AllArgsConstructor /*私有的构造方法*/

@Slf4j
@CommonsLog(topic = "commonLog")
// @Slf4j @CommonsLog(topic = "commonLog")编译后 private static final Logger log = LoggerFactory.getLogger("commonLog");

public enum EnumConstant {
    /* eg   */
    PRIMARY("1", "小学"),
    SECONDORY("2", "中学"),
    HIGH("3", "高中")


    ;

    //转map使用
    public  static final Map<String,EnumConstant> map_EnumConstant=new HashMap<>();;
    static {
        Arrays.stream(values()).forEach((enumConstant) -> {
            map_EnumConstant.put(enumConstant.getCode(), enumConstant);
        });
    }


    private final String code;
    private final String descp;
}
